package cn.zyq.ykb.controller.h5.user;

import cn.zyq.ykb.beans.user.PosUser;
import cn.zyq.ykb.service.user.PosUserService;
import cn.zyq.ykb.system.annotation.Log;
import cn.zyq.ykb.system.common.BaseController;
import cn.zyq.ykb.system.common.PageParam;
import cn.zyq.ykb.system.ry.enums.BusinessType;
import cn.zyq.ykb.system.ry.util.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * pos用户Controller
 *
 * @author SystemAuth
 * @date 2024-03-06
 */

@RestController(value = "H5PosUserController")
@RequestMapping("/file/posUser")
@Api(tags = "pos用户接口")
public class PosUserController extends BaseController {

    @Autowired
    private PosUserService posUserService;

    /**
     * 查询pos用户列表
     */
    @ApiOperation(value = "列表", response = PosUser.class)
    @PostMapping("/list")
    public Object list(@RequestBody PageParam pageParam) {
        return this.posUserService.selectPosUserList(pageParam);
    }


    /**
     * 新增pos用户
     */
    @ApiOperation(value = "新增")
    @Log(title = "pos用户", businessType = BusinessType.INSERT)
    @PostMapping
    public Object add(@RequestBody PosUser posUser) {
        return this.posUserService.insertPosUser(posUser);
    }

}
